@inherits Umbraco.Web.Macros.PartialViewMacroPage
@*
    Macro parameter to be set on the macro
    Alias:propertyAlias     Name:Property Alias    Type:Textbox
*@   

@{
    @* Get the property alias we want to filter on from the macro parameter *@
    var propertyAlias = Model.MacroParameters["propertyAlias"];
    var selection = CurrentPage.Children.Where("Visible").OrderBy(propertyAlias);
}

<ul>
    @foreach (var page in selection)
    { 
        <li><a href="@page.Url">@page.Name</a></li>
    }
</ul>
